<?php 
namespace Home\Controller;
class EmptyController extends CommonController{

	public function _initialize(){
		if (IS_GET) {
			if (ACTION_NAME == 'index') {
				$_where = array(
					'name' => array('eq',strtolower(CONTROLLER_NAME)),
					'status' => array('eq',1)
					);
			}else{
				$_where = array(
					'name' => array('eq',strtolower(CONTROLLER_NAME.'/'.ACTION_NAME)),
					'status' => array('eq',1)
					);
			}
			$single = $m = M('Single') -> where($_where) -> find();
			if ($single) {
				$single['ext'] = json_decode($single['ext'],true);
				$this -> SEO = array(
					'title' =>  $single['title'],
					'keywords'  =>  $single['keywords'],
					'description'   =>  $single['description'],
					);
				$this -> single = $single;
				$this -> display('Single/'.$single['tpl']);
			}else{
				$this -> error('非法访问！');
			}
		}else{
			$this -> error('非法访问！');
		}
	}
}